# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: schuay <jakob.gruber@gmail.com>
# Contributor: Roman Zimbelmann <romanz@lavabit.com>

pkgname=ranger
pkgver=1.9.3
pkgrel=9
pkgdesc='Simple, vim-like file manager'
arch=('any')
url='https://ranger.github.io'
license=('GPL')
depends=('python')
optdepends=(
    'atool: for previews of archives'
    'elinks: for previews of html pages'
    'ffmpegthumbnailer: for video previews'
    'highlight: for syntax highlighting of code'
    'imagemagick: auto-rotate image previews based on EXIF data'
    'libcaca: for ASCII-art image previews'
    'lynx: for previews of html pages'
    'mediainfo: for viewing information about media files'
    'odt2txt: for OpenDocument texts'
    'perl-image-exiftool: for viewing information about media files'
    'poppler: for pdf previews'
    'python-chardet: in case of encoding detection problems'
    'python-pillow: for in-terminal preview of images in Kitty'
    'sudo: to use the "run as root"-feature'
    'transmission-cli: for viewing bittorrent information'
    'ueberzug: for previews of images'
    'w3m: for previews of images and html pages')
checkdepends=('python-pytest')
makedepends=(python-{build,installer,wheel}
             python-setuptools)
source=(https://ranger.github.io/${pkgname}-${pkgver}.tar.gz{,.sig})
sha512sums=('5cd7bea714a6542d0a5445f5f0cf929b2df4377df3ef710f3786c6c46dd58b017a8060cde3969076637bfaac03c13297d3020fd82f4574dc49546ca223c0e8d3'
            'SKIP')
validpgpkeys=('1E9B36EC051FF6F7FFC969A7F08CE1E200FB5CDF'
              '66FA95C0F1619BDA520A41F60D63346A5D15D055') # huterich

build() {
  cd ${pkgname}-${pkgver}
  python -m build -wn
}

check() {
  cd ${pkgname}-${pkgver}
  local _pyver=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
  export PYTHONPATH="$PWD/lib.linux-$CARCH-cpython-$_pyver"
  export TERM=linux
  python -m unittest discover
}

package() {
  cd ${pkgname}-${pkgver}
  python -m installer -d "$pkgdir" dist/*.whl
}

# vim: ts=2 sw=2 et:
